fix(ts): resolve R7 QA issues and negotiate facilitator compatibility - #1010
Merged
gummy789j merged 5 commits intoSep 17, 2026
Merged
Conversation
gummy789j
reviewed
Sep 17, 2026
| try { | ||
| response = await fetchBounded( | ||
| fetcher, | ||
| new URL("/supported", base), |
Collaborator
There was a problem hiding this comment.
/supported discards the path component of the facilitator URL
Failure scenario: x402 serve --network tron --facilitator-url https://host/x402 (the schema only requires an HTTPS URL) → negotiation hits https://host/supported → 404 → provider_error, and the server refuses to start — even though https://host/x402/verify would have worked.
Suggestion: use the same base-joining logic as facilitator() new URL(path, ${base.replace(/\/+$/, "")}/),
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fix the remaining v4.14 QA failures in credential output, payment validation, order pagination and registration metadata loading. B.AI retains Base support, recipient recharge and initial wallet binding.
provider_rate_limited, retain safe numeric Retry-After hints, and preserve the no-automatic-repayment rule.Facilitator compatibility and README
TRON local serve/roundtrip/recharge now reads the configured facilitator's
/supportedbefore advertising a challenge. It matches x402 v2, the scheme and chain identity,
uses decimal IDs when advertised, and otherwise uses the supported hexadecimal ID.
When both formats are supported, decimal is preferred. Missing/invalid capabilities
stop before signing. Signed payloads are never rewritten and settlement is not retried
with another format after failure. EVM IDs remain unchanged.
README now explains capability negotiation, server/daemon options, B.AI setup,
preview and report-only recovery, and ERC-8004 metadata limits. No
docs/changesare included.
Validation
/supportedadvertised hexadecimal TRON IDs; the local server selected Niletron:0xcd8690dcwhile retaining CLI networktron:3448148188. No payment was sent.No npm publication. Real B.AI crediting, live x402 settlement, mainnet payments, physical hardware signing and Windows/Linux standalone execution were not performed in this validation run. Suite totals overlap and should not be added together.
R8 follow-up
BAI recharge now rejects non-positive, malformed, out-of-range and below-minimum amounts with
invalid_amount(exit 2) before wallet/credential gates. Within the recharge use case, token precision validation runs before account resolution, binding checks, recipient lookup or preorder creation. Recharge recovery uses the same amount error contract. Existing token-specific minimums, Base support and recipient recharge remain unchanged.Installed-CLI regressions exercise both
x402 payandroundtripwith the real GasFree SDK and a random software signer against mocked RPC/HTTP services. The tests assert that a 1,300,000-raw fee ceiling on a 10,000-raw payment appears as13000.00%in the final JSON warnings, with successful settlement/delivery and no duplicate payment requests. Empty-wallet CLI cases assert that invalid BAI amounts fail withinvalid_amountbefore asking for credentials.Facilitator path and Nile GasFree USDD follow-up
Facilitator
/supported,/verifyand/settlenow share URL joining that retains deployment path prefixes (for examplehttps://host/x402/). Integration tests verify the complete negotiation and settlement sequence under a prefix.Nile USDD is selected by payment scheme: exact retains
TGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK, while exact_gasfree uses the relay-supportedTYQF9cAeJ3Faq8QXpHxTcFco72DRCQbgFt(18 decimals). Explicit requirements are never rewritten to another asset. The SDK receives GasFree metadata under an internal alias so its exact USDD entry stays intact, including when the SDK falls back to a one-token fee ceiling.Missing GasFree assets during payload creation now produce
gasfree_asset_unsupported,paymentStatus=not_sent, andretryPayment=false, without exposing raw upstream error text.Validation: 171 targeted tests passed; 84 freshly installed-package tests passed, including real SDK signing for both USDD schemes, GasFree fee precision/fallback and missing-asset cases without payment submission. Typecheck, lint, formatting and dependency checks passed. No live payment, npm publication or docs changes in this follow-up.
The full-suite run passed 2,923 tests and found one missing error-code index entry. The entry was added, and the 171-test follow-up reran the index guard and all x402 adapter tests successfully. The full suite was not rerun after that index-only correction.